<template>
  <component
      :is="containerComponent"
      v-model="innerDialogShow"
  >
    <slot></slot>
  </component>
</template>

<script>

import { QDialog } from 'quasar'

export default {
  name: 'WidgetEditFormContainer',
  components: {
    QDialog
  },
  props: {
    inline: Boolean,
    modelValue: Boolean
  },
  data () {
    return {
      innerDialogShow: this.modelValue,
      containerComponent: this.inline ? 'div' : 'q-dialog'
    }
  },
  watch: {
    innerDialogShow () {
      this.$emit('update:modelValue', this.innerDialogShow)
    },
    modelValue () {
      this.innerDialogShow = this.modelValue
    }
  }
}
</script>

<style lang="scss">

</style>
